package com.regent.central.bill.service;

import com.regent.central.bill.core.Delivery;
import com.regent.central.bill.dto.delivery.DeliveryDetailDTO;
import com.regent.central.bill.dto.delivery.DeliveryOrderDTO;
import com.regent.central.bill.dto.delivery.DeliveryRecordDTO;
import com.regent.central.bill.dto.delivery.DeliverySaleOrderDTO;
import com.regent.central.infrastructure.service.DomainService;

import java.util.List;

public interface DeliveryOrderService  extends DomainService<Delivery> {
    /**
     * 获取发货动作列表
     * @param unitId
     * @param keyword
     * @param empIds
     * @param startSearchTime
     * @param startTime
     * @param endTime
     * @param pageNo
     * @param pageSize
     */
    List<DeliveryOrderDTO> getDeliveryOrder(String unitId, String keyword, List<String> empIds, String startSearchTime,
                                            String startTime, String endTime, int pageNo, int pageSize);

    /**
     * 发货单详情
     * @param deliveryOrderId
     * @return
     */
    DeliveryDetailDTO getDeliveryOrderDetail(String deliveryOrderId);

    /**
     * 发货单操作记录
     * @param deliveryOrderId
     * @return
     */
    List<DeliveryRecordDTO> getDeliveryOrderRecord(String deliveryOrderId);

//    /**
//     * 获取该日期最后一个发货单
//     * @param unitId
//     * @param deliveryDay
//     * @return
//     */
//    Delivery getLastRecordByDate(String unitId,String deliveryDay);

    Integer getMaxDeliveryNoByDate(String unitId,String deliveryDay);

    /**
     * 撤销发货
     * @param deliveryOrderId
     */
    void revoke(String deliveryOrderId,String userId );

    /**
     * 作废发货单
     * @param deliveryOrderId
     * @param userId
     */
    void canceledDeliveryOrder(String deliveryOrderId,String userId);

    /**
     *
     * @param deliveryOrderId
     * @param unitId
     * @param customerId
     * @param startSearchTime
     * @param startTime
     * @param endTime
     * @param sortBy
     * @param sortAs
     * @return
     */
    List<DeliverySaleOrderDTO> getEditSaleOrders(
            String deliveryOrderId,
            String unitId,
            String customerId,
            String startSearchTime,
            String startTime,
            String endTime,
            String sortBy,
            Integer sortAs
            );
}
